package com.zt.eb.freshlife.controller;



import com.zt.eb.freshlife.model.EbProduct;
import com.zt.eb.freshlife.service.EbProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller  //迎宾证
@RequestMapping("/product")    //工号


public class EbProductController {
    @Autowired     //service层的对象
    private EbProductService ebProductService;



    @RequestMapping("/detail")
    public String detail(Model model,Integer epId){
        System.out.println("=====浏览器点击了某个商品======:epId=="+epId);


        //调用service查询商品信息
       EbProduct productDetail =ebProductService.detail(epId);
        //绑定model中
        model.addAttribute("detail",productDetail);
        return "index_7";
    }




}
